#include<bits/stdc++.h>
using namespace std;
#define int long long

char a[15];

signed main() {
	scanf("%c-%c%c%c-%c%c%c%c%c-%c", a + 1, a + 2, a + 3, a + 4, a + 5, a + 6, a + 7, a + 8, a + 9, a + 10);
	int sum = 0;
	for (int i = 1; i <= 9; i++)
		sum += i * (a[i] - '0');
	sum %= 11;
	if (sum + '0' == a[10] || (sum == 10 && a[10] == 'X'))
		printf("Right");
	else
		printf("%c-%c%c%c-%c%c%c%c%c-%c", a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], sum == 10 ? 'X' : sum + '0');
	return 0;
}
